<!DOCTYPE html>
<html>
  <head>
    <!-- Required meta tags-->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <!-- Your app title -->
    <title>帐号绑定</title>
    <!-- Path to Framework7 Library CSS-->
    <link rel="stylesheet" href="/wechat/static/src/framework7/css/framework7.min.css">
    <!-- Path to your custom app styles-->
    <link rel="stylesheet" href="/wechat/static/src/framework7/css/my-app.css">
<style>
div[class*="col-"] {
  background: #fff;
  text-align: center;
  color: #000;
  padding: 5px;
}
.row {
  /*margin-bottom: 15px;*/
}

.icon-form-button{
    width: 29px;
    height: 29px;
}

</style>
</head>
<body>
<div class="page-content">

<div class="content-block">
    <div class="row">
      <div class="col-100">
<% if session.uid %>
        <div class="content-block" ms-controller="cancel-binding">
        您已经绑定账号: ${session.login}<br />
        点击按钮取消绑定<br />
        <p>
            <a href="#" id="btn-cancel-binding" class="button button-big active" ms-click="do_cancel_binding" ms-visible="result!='OK'">取消绑定</a>
        </p>
        <div class="row" ms-visible="result=='OK'">
            <div class="col-100">
                已经取消绑定，按左上角返回键返回
            </div>
        </div>

    </div>
<% elif session.oauth_access_token %>
    <!-- 绑定表单 -->
    <div class="list-block" ms-controller="binding-form">
        <div class="content-block" ms-visible="!uid">
            <p>
            您未绑定账号，<br />
            请输入手机号码进行绑定：
            </p>
        </div>
        <form id="form-binding" action="/weixin/do_binding" method="GET" class="ajax-submit">
        <ul>
            <li>
                <div class="item-content">
                    <div class="item-media"><i class="icon icon-form-tel"></i></div>
                    <div class="item-inner">
                        <div class="item-title label">手机</div>
                        <div class="item-input">
                          <input name="mobile" ms-duplex="mobile" placeholder="11位手机号码" type="tel">
                        </div>
                    </div>
                </div>
            </li>
            <li ms-visible="mobile_verified==true && !uid">
                <div class="item-content">
                    <div class="item-media"><i class="icon icon-form-button"></i></div>
                    <div class="item-inner">
                        <div class="item-title label"></div>
                        <div class="item-input">
                            <div class="row">
                                <div class="col-30"></div>
                                <div class="col-70">
                                    <a href="#" class="button" ms-class="disabled: sms_send_interval &lt; 60" ms-click="send_sms_auth_code" >
                                        <span ms-if="sms_send_interval &lt; 60">
                                            已发送({{sms_send_interval}}秒后可重发)
                                        </span>
                                        <span ms-if="sms_send_interval == 60">
                                            发送短信验证码
                                        </span>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </li>
            <li>
                <div class="item-content">
                  <div class="item-media"><i class="icon icon-form-password"></i></div>
                  <div class="item-inner">
                    <div class="item-title label">验证码</div>
                    <div class="item-input">
                      <input ms-duplex="auth_code" placeholder="短信验证码" type="text">
                    </div>
                  </div>
                </div>
            </li>
        </ul>
        </form>
        <div class="content-block">
            <p>
                <a href="#" class="button button-big active" ms-click="do_binding" ms-visible="!uid">进行绑定</a>
            </p>
            <div class="row" ms-visible="uid">
                <div class="col-100">
                    已经成功绑定到帐号{{login_id}}<br />
                    按左上角返回键返回
                </div>
            </div>
        </div>
    </div>
    <!-- end 绑定表单 -->
<% else %>
    <div class="content-block">
        <p>
        您未绑定账号<br />
        按左上角返回，重新进入绑定操作
        </p>
    </div>

<% endif %>
      </div>
    </div>
</div>

</div>
    <!-- avalon -->
    <script type="text/javascript" src="/wechat/static/src/avalon/avalon.modern.min.js"></script>
    <!-- Path to Framework7 Library JS-->
    <script type="text/javascript" src="/wechat/static/src/framework7/js/framework7.min.js"></script>
    <!-- Path to your app js-->
    <script type="text/javascript" src="/dzx_weixin/static/src/js/my-app.js"></script>
  </body>
</html>
